/**
* Exoplanet Custom JS
*
* @package Exoplanet
*
* Distributed under the MIT license - http://opensource.org/licenses/MIT
*/
jQuery(window).load(function() {
jQuery(".preloader").delay(2000).fadeOut("slow");
});
jQuery('#menu').css("right","-300px");
jQuery('.menu_icon').on('click',function(){
if(jQuery('.menu_icon').hasClass('open')){
jQuery(this).removeClass('open');
jQuery(this).removeClass('position-fixed');
jQuery(this).animate({
"top":"-24px",
"right":"30px",
"z-index":"6"
});
jQuery('#menu').animate({"right":"-300px"});
}
else{
jQuery(this).addClass('open');
jQuery(this).addClass('position-fixed');
jQuery(this).animate({
"position":"fixed",
"top":"10px",
"right":"267px",
"z-index":"6"
});
jQuery('#menu').animate({"right":"0px"});
}
});
jQuery('.clk a').click(function(){
jQuery(this).find('i').toggleClass('fa-bars fa-times-circle')
});
jQuery(function($){
"use strict";
jQuery('.menu > ul').superfish({
delay: 500,
animation: {opacity:'show',height:'show'},
speed: 'fast'
});
/* Top Search */
jQuery('.search-box span i').click(function(){
jQuery(".serach_outer").toggle();
});
});
jQuery('document').ready(function(){
jQuery("#services_heading_words").html(function() {
var text = jQuery(this).text().trim();
var words = text.split(" ");
if (words.length >= 3) {
words[2] = "" + words[2] + ""; // 3rd word
}
// Join all words to form the updated text
var updatedText = words.join(" ");
return updatedText;
});
jQuery("#products_heading_words").html(function() {
var text = jQuery(this).text().trim();
var words = text.split(" ");
if (words.length >= 3) {
words[2] = "" + words[2] + ""; // 3rd word
}
// Join all words to form the updated text
var updatedText = words.join(" ");
return updatedText;
});
jQuery("#consultation_heading_words").html(function() {
var text = jQuery(this).text().trim();
var words = text.split(" ");
if (words.length >= 3) {
words[3] = "" + words[3] + ""; // 3rd word
}
// Join all words to form the updated text
var updatedText = words.join(" ");
return updatedText;
});
jQuery("#testimonial_heading_words").html(function() {
var text = jQuery(this).text().trim();
var words = text.split(" ");
if (words.length >= 3) {
words[3] = "" + words[3] + ""; // 3rd word
}
// Join all words to form the updated text
var updatedText = words.join(" ");
return updatedText;
});
jQuery("#teams_heading_words").html(function() {
var text = jQuery(this).text().trim();
var words = text.split(" ");
if (words.length >= 3) {
words[2] = "" + words[2] + ""; // 3rd word
}
// Join all words to form the updated text
var updatedText = words.join(" ");
return updatedText;
});
jQuery("#contact-form-heading").html(function() {
var text = jQuery(this).text().trim();
var words = text.split(" ");
if (words.length >= 1) {
words[1] = "" + words[1] + ""; // 3rd word
}
// Join all words to form the updated text
var updatedText = words.join(" ");
return updatedText;
});
var owl = jQuery('#carousel-slider-section .owl-carousel');
owl.owlCarousel({
nav:true,
autoplay : true,
lazyLoad: true,
autoplayTimeout: 5000,
loop: true,
dots:true,
navText : ['',''],
responsive: {
0: {
items: 1
},
600: {
items: 1
},
1000: {
items: 1
}
},
autoplayHoverPause : true,
mouseDrag: true
});
});
// Our Experts
jQuery('document').ready(function(){
var owl = jQuery('#our-experts .owl-carousel');
owl.owlCarousel({
margin:40,
nav: true,
autoplay : true,
lazyLoad: true,
smartSpeed: 3000,
autoplayTimeout: 3000,
loop: true,
dots:true,
navText : ['',''],
responsive: {
0: {
items: 1
},
576: {
items: 2
},
768: {
items: 2
},
1000: {
items: 4
}
},
autoplayHoverPause : true,
mouseDrag: true
});
});
// Our Clients
jQuery('document').ready(function(){
var owl = jQuery('#our-clients .owl-carousel');
owl.owlCarousel({
margin:60,
nav: false,
autoplay : true,
lazyLoad: true,
autoplayTimeout: 3000,
loop: true,
smartSpeed: 1000,
dots:true,
navText : ['',''],
responsive: {
0: {
items: 1
},
576: {
items: 2
},
768: {
items: 2
},
1000: {
items: 3
}
},
autoplayHoverPause : true,
mouseDrag: true
});
var owl = jQuery('#best-products .owl-carousel');
owl.owlCarousel({
margin:20,
nav: false,
autoplay : true,
lazyLoad: true,
autoplayTimeout: 3000,
smartSpeed: 3000,
loop: true,
dots:true,
navText : ['',''],
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1000: {
items: 4
}
},
autoplayHoverPause : true,
mouseDrag: true
});
});
// Our Clients
jQuery('document').ready(function(){
// ------------ Sticky Navbar -------------------
window.onscroll = function() {
if ( jQuery('#sticky-onoff').html() == 'yes' ) {
myScrollNav()
}
};
var navbar = document.getElementById("header");
var sticky = navbar.offsetTop;
function myScrollNav() {
if (window.pageYOffset > sticky) {
//alert(window.pageYOffset);
navbar.classList.add("sticky");
navbar.classList.add("stickynavbar");
} else {
navbar.classList.remove("sticky");
navbar.classList.remove("stickynavbar");
}
}
jQuery('#services .count ,#our-experts .count').each(function () {
var $this = jQuery(this);
var finalVal = $this.text().trim();
$this.prop('Counter', 0).animate({
Counter: parseFloat(finalVal)
}, {
duration: 8000,
easing: 'swing',
step: function (now) {
if (finalVal.includes('.')) {
$this.text(now.toFixed(1)); // keep one decimal if original had a dot
} else {
$this.text(Math.floor(now)); // whole number if original was whole
}
},
complete: function () {
// Final formatting just to ensure clean end value
if (finalVal.includes('.')) {
$this.text(parseFloat(finalVal).toFixed(1));
} else {
$this.text(parseInt(finalVal));
}
}
});
});
new WOW().init();
});
//
// Show button when user scrolls down
const scrollBtn = document.getElementById("copyright-top-button");
window.addEventListener("scroll", () => {
const scrollTop = window.scrollY || document.documentElement.scrollTop;
const docHeight = document.documentElement.scrollHeight - window.innerHeight;
// Show button after 49px scroll
if (scrollTop > 49) {
scrollBtn.classList.add("show");
// Calculate fill percent: from 0% at 50px scroll to 100% at bottom of page
let fillPercent = 0;
if (scrollTop >= 50) {
fillPercent = ((scrollTop - 50) / (docHeight - 50)) * 100;
if (fillPercent > 100) fillPercent = 100;
}
// Set dynamic background gradient fill from bottom up
scrollBtn.style.background = `linear-gradient(to top, #D2924F ${fillPercent}%, transparent ${fillPercent}%)`;
} else {
scrollBtn.classList.remove("show");
scrollBtn.style.background = 'linear-gradient(to top, #D2924F 0%, transparent 0%)';
}
});
scrollBtn.addEventListener("click", () => {
window.scrollTo({ top: 0, behavior: "smooth" });
});